package main

import (
	"fmt"
	"regexp"
)

// RestrictedNameChars collects the characters allowed to represent a name, normally used to validate container and volume names.
const RestrictedNameChars = `[a-zA-Z0-9][a-zA-Z0-9_.-]`

// RestrictedNamePattern is a regular expression to validate names against the collection of restricted characters.
var RestrictedNamePattern = regexp.MustCompile(`^` + RestrictedNameChars + `+$`)

var R2 = regexp.MustCompile("^\\/([a-zA-Z0-9]([a-zA-Z0-9_.-])*(\\/)?)+")

func main() {
	if R2.MatchString("/，") {
		fmt.Println(true)
	} else {
		fmt.Println(false)
	}

	if R2.MatchString("a") {
		fmt.Println(true)
	} else {
		fmt.Println(false)
	}

	if R2.MatchString("/1023") {
		fmt.Println(true)
	} else {
		fmt.Println(false)
	}
}
